//
//  PHStatusRetweetView.swift
//  PHWeibo
//
//  Created by 潘荟 on 16/7/23.
//  Copyright © 2016年 BAT. All rights reserved.
//

import UIKit

class PHStatusRetweetView: UIView {
    
    //供外界赋值
    var statusViewModel:PHStatusViewModel?{
        didSet{
            contentLabel.text = statusViewModel?.status?.retweeted_status?.text
        }
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    //设置页面
    func setupUI() {
        
        self.backgroundColor = RGB(230, green: 230, blue: 230, alpha: 1)
        
        //添加子控件
        addSubview(contentLabel)
        
        //设置约束
        contentLabel.snp_makeConstraints { (make) -> Void in
            make.top.leading.equalTo(10)
        }
        //约束当前的view
        self.snp_makeConstraints { (make) -> Void in
            make.bottom.equalTo(contentLabel).offset(10)
        }
        
    }
    
    //懒加载子控件
    private lazy var contentLabel:UILabel = UILabel(textColor: UIColor.darkGrayColor(), textFont: 15, maxWidth: SCREENW - 20)

}
